<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum);netstandard2.0</TargetFrameworks>
    <TargetFrameworks Condition="'$(NetCoreAppPrevious)' != ''">$(TargetFrameworks);$(NetCoreAppPrevious)-windows;$(NetCoreAppPrevious)</TargetFrameworks>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <IncludeDllSafeSearchPathAttribute>true</IncludeDllSafeSearchPathAttribute>
    <NoWarn>$(NoWarn);CA2249</NoWarn>
    <NoWarn>$(NoWarn);IDE0059;IDE0060;CA1822;CA1859</NoWarn>
    <EnableAOTAnalyzer>false</EnableAOTAnalyzer>
    <UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
    <IsPackable>true</IsPackable>
    <AddNETFrameworkPlaceholderFileToPackage>true</AddNETFrameworkPlaceholderFileToPackage>
    <AddNETFrameworkAssemblyReferenceToPackage>true</AddNETFrameworkAssemblyReferenceToPackage>
    <PackageDescription>Provides uniform access and manipulation of user, computer, and group security principals across the multiple principal stores: Active Directory Domain Services (AD DS), Active Directory Lightweight Directory Services (AD LDS), and Machine SAM (MSAM).</PackageDescription>

    <!-- TODO https://github.com/dotnet/runtime/issues/90400: Annotate for nullable reference types -->
    <Nullable>disable</Nullable>
    <NoWarn>$(NoWarn);nullable</NoWarn>
  </PropertyGroup>

  <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
  <PropertyGroup>
    <TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
    <GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' != 'windows'">SR.DirectoryServicesAccountManagement_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
  </PropertyGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
    <Compile Include="System\DirectoryServices\AccountManagement\interopt.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\PrincipalSearcher.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\Utils.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\constants.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\Context.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\StoreCtx.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\StoreKey.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\Principal.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AuthenticablePrincipal.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\User.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\Computer.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\Group.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AccountInfo.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\PasswordInfo.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\MatchType.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\CredentialTypes.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\ContextType.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\ContextOptions.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\SidType.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\ResultSet.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\EmptySet.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\QbeFilterDescription.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\PrincipalCollection.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\PrincipalCollectionEnumerator.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\TrackedCollection.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\TrackedCollectionEnumerator.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\ValueCollection.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\ValueCollectionEnumerator.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\Pair.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\FindResult.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\FindResultEnumerator.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\exceptions.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\IdentityType.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\UrnScheme.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\GroupType.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AuthZSet.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\ConfigurationHandler.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\GlobalConfig.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\GlobalDebug.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\NetCred.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\ExtensionAttributes.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\ExtensionCache.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\ExtensionHelper.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AdvancedFilters.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AD\QBEMatchType.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AD\SidList.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AD\ADDNConstraintLinkedAttrSet.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AD\DSPropertyCollection.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AD\ADStoreCtx.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AD\ADStoreCtx_Query.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AD\ADStoreCtx_LoadStore.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AD\ADStoreKey.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AD\ADEntriesSet.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AD\ADDNLinkedAttrSet.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AD\ADUtils.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AD\SDSUtils.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AD\SDSCache.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AD\RangeRetriever.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AD\ADAMStoreCtx.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\AD\TokenGroupsSet.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\SAM\SAMStoreCtx.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\SAM\SAMStoreCtx_Query.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\SAM\SAMStoreCtx_LoadStore.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\SAM\SAMQuerySet.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\SAM\SAMMembersSet.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\SAM\SAMGroupsSet.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\SAM\SAMStoreKey.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\SAM\SAMUtils.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\IdentityClaim.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\IdentityReference.cs" />
    <Compile Include="System\DirectoryServices\AccountManagement\UnknownPrincipal.cs" />

    <Compile Include="$(CommonPath)Interop\Windows\Interop.BOOL.cs"
             Link="Common\Interop\Windows\Interop.BOOL.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Interop.BOOLEAN.cs"
             Link="Common\Interop\Windows\Interop.BOOLEAN.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs"
             Link="Common\Interop\Windows\Interop.Libraries.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Interop.OBJECT_ATTRIBUTES.cs"
             Link="Common\Interop\Windows\Interop.OBJECT_ATTRIBUTES.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Interop.SECURITY_QUALITY_OF_SERVICE.cs"
             Link="Common\Interop\Windows\Interop.SECURITY_QUALITY_OF_SERVICE.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Interop.UNICODE_STRING.cs"
             Link="Common\Interop\Windows\Interop.UNICODE_STRING.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Activeds\Interop.ADsOpenObject.cs"
             Link="Common\Interop\Windows\Activeds\Interop.ADsOpenObject.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.ConvertSidToStringSid.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.ConvertSidToStringSid.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.ConvertStringSidToSid.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.ConvertStringSidToSid.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.CopySid.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.CopySid.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.EqualDomainSid.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.EqualDomainSid.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.GetLengthSid.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.GetLengthSid.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.GetSidIdentifierAuthority.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.GetSidIdentifierAuthority.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.GetTokenInformation.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.GetTokenInformation.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.ImpersonateLoggedOnUser_IntPtr.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.ImpersonateLoggedOnUser_IntPtr.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.IsValidSid.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.IsValidSid.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.LogonUser.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.LogonUser.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.LookupAccountSid.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.LookupAccountSid.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.LsaClose.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.LsaClose.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.LsaFreeMemory.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.LsaFreeMemory.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.LsaLookupSids.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.LsaLookupSids.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.LsaNtStatusToWinError.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.LsaNtStatusToWinError.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.LsaOpenPolicy.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.LsaOpenPolicy.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.LsaQueryInformationPolicy.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.LsaQueryInformationPolicy.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.OpenThreadToken_SafeTokenHandle.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.OpenThreadToken_SafeTokenHandle.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.OpenProcessToken.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.OpenProcessToken.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.RevertToSelf.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.RevertToSelf.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.TOKEN_INFORMATION_CLASS.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.TOKEN_INFORMATION_CLASS.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Authz\Interop.AuthzGetInformationFromContext.cs"
             Link="Common\Interop\Windows\Authz\Interop.AuthzGetInformationFromContext.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Authz\Interop.AuthzInitializeContextFromSid.cs"
             Link="Common\Interop\Windows\Authz\Interop.AuthzInitializeContextFromSid.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Authz\Interop.AuthzInitializeResourceManager.cs"
             Link="Common\Interop\Windows\Authz\Interop.AuthzInitializeResourceManager.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Credui\Interop.CredUIParseUserName.cs"
             Link="Common\Interop\Windows\Credui\Interop.CredUIParseUserName.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Dsrole\Interop.DsRoleFreeMemory.cs"
             Link="Common\Interop\Windows\Dsrole\Interop.DsRoleFreeMemory.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Dsrole\Interop.DsRoleGetPrimaryDomainInformation.cs"
             Link="Common\Interop\Windows\Dsrole\Interop.DsRoleGetPrimaryDomainInformation.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.CloseHandle.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.CloseHandle.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.GetCurrentProcess.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.GetCurrentProcess.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.GetCurrentThread.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.GetCurrentThread.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.GetCurrentThreadId.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.GetCurrentThreadId.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.LocalFree.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.LocalFree.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Logoncli\Interop.DsGetDcName.cs"
             Link="Common\Interop\Windows\Logoncli\Interop.DsGetDcName.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Netutils\Interop.NetApiBufferFree.cs"
             Link="Common\Interop\Windows\Netutils\Interop.NetApiBufferFree.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\NtDll\Interop.NtStatus.cs"
             Link="Common\Interop\Windows\NtDll\Interop.NtStatus.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\SspiCli\Interop.LSAStructs.cs"
             Link="Common\Interop\Windows\SspiCli\Interop.LSAStructs.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\SspiCli\Interop.TOKENS.cs"
             Link="Common\Interop\Windows\SspiCli\Interop.TOKENS.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Wkscli\Interop.NetWkstaGetInfo.cs"
             Link="Common\Interop\Windows\Wkscli\Interop.NetWkstaGetInfo.cs" />
    <Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeLsaMemoryHandle.cs"
             Link="Common\Microsoft\Win32\SafeHandles\SafeLsaMemoryHandle.cs" />
    <Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeLsaPolicyHandle.cs"
             Link="Common\Microsoft\Win32\SafeHandles\SafeLsaPolicyHandle.cs" />
    <Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeTokenHandle.cs"
             Link="Common\Microsoft\Win32\SafeHandles\SafeTokenHandle.cs" />
    <Compile Include="$(CommonPath)System\Obsoletions.cs"
             Link="Common\System\Obsoletions.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
    <Compile Include="$(CommonPath)DisableRuntimeMarshalling.cs"
             Link="Common\DisableRuntimeMarshalling.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
    <ProjectReference Include="$(LibrariesProjectRoot)System.Configuration.ConfigurationManager\src\System.Configuration.ConfigurationManager.csproj" />
    <ProjectReference Include="$(LibrariesProjectRoot)System.DirectoryServices\src\System.DirectoryServices.csproj" />
    <ProjectReference Include="$(LibrariesProjectRoot)System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'">
    <PackageReference Include="System.Security.Principal.Windows" Version="$(SystemSecurityPrincipalWindowsVersion)" />
  </ItemGroup>

</Project>
